package com.haoran.dwz.common.threadpool;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
/**
 * Created by 10412 on 2017/7/24.
 * 自定义拒绝策略，实现 RejectedExecutionHandler 接口
 */
public class RejectedThreadPoolHandler implements RejectedExecutionHandler
{
    public RejectedThreadPoolHandler() {
    }
    @Override
    public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        System.out.println("WARNING 自定义拒绝策略: Task " + r.toString() + " rejected from " + executor.toString());
    }
}